From: Jonathan Lebon Date: Tue, 20 Sep 2016 15:45:57 +0000 (-0400) Subject: ostree_sysroot_init_osname: also create /var/log X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~46^2~7 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/?a=commitdiff_plain;h=318430dc700973fbc54c5469343c45aaab4701a7;p=ostree.git ostree_sysroot_init_osname: also create /var/log /var/log is another one of those core directories that should be made available and properly labeled during early boot before tmpfiles.d starts up. Related: https://bugzilla.redhat.com/show_bug.cgi?id=1265295 Closes: #513 Approved by: cgwalters --- diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c index de92691a..ee87128d 100644 --- a/src/libostree/ostree-sysroot.c +++ b/src/libostree/ostree-sysroot.c @@ -1487,6 +1487,16 @@ ostree_sysroot_init_osname (OstreeSysroot *self, goto out; } + /* This needs to be available and properly labeled early during the boot + * process (before tmpfiles.d kicks in), so that journald can flush logs from + * the first boot there. https://bugzilla.redhat.com/show_bug.cgi?id=1265295 + * */ + if (mkdirat (dfd, "var/log", 0755) < 0) + { + glnx_set_prefix_error_from_errno (error, "Creating %s", "var/log"); + goto out; + } + if (symlinkat ("../run", dfd, "var/run") < 0) { glnx_set_prefix_error_from_errno (error, "Symlinking %s", "var/run");